import { ToolTipItem } from "../../../../../com/mui/manager/ToolTipItem";
import { LoaderHelp } from "../../../../common/display/LoaderHelp";
import { Cache } from "../../../cache/Cache";
import { Language } from "../../../../../extend/language/Language";
import { GlobalClass } from "../../../../../com/mui/core/GlobalClass";
type int = number;
//class WuXingDiceWordItem
    
    export  class WuXingDiceWordItem extends ToolTipItem
    {
        constructor()
        {
            super();
            this.init();
            return;
        }

        /* internal  */init(): void
        {
            this._bg = new Object /* flash.display.Bitmap */();
            this.addChild(this._bg);
            LoaderHelp.addResCallBack("skillUI.swf", this.onBgLoadedHandler);
            this._bitmap = new Object /* flash.display.Bitmap */();
            this._bitmap.x = 10;
            this._bitmap.y = 12;
            this.addChild(this._bitmap);
            return;
        }

        public get wuxing(): int
        {
            return this._wuxing;
        }

        public set wuxing(arg1: int)
        {
            this._wuxing = arg1;
            this._mainAttr = Cache.instance.role.wuxingInfo.mainAttribute;
            LoaderHelp.addResCallBack("wuxingbg.swf", this.onWxLodedHandler);
            if (this._wuxing != this._mainAttr) 
            {
                this.filters = [];
                if (this.freeLeftTimes > 0) 
                {
                    this.toolTipData = Language.getStringByParam(26215, this.freeLeftTimes);
                }
                else 
                {
                    this.toolTipData = Language.getStringByParam(26213, this.cost);
                }
            }
            else 
            {
                this.toolTipData = null;
                this.filters = [WuXingDiceWordItem.glowFilter];
            }
            return;
        }

        /* internal  */onWxLodedHandler(): void
        {
            this._bitmap.bitmapData = GlobalClass.getBitmapData("wxAttrShort_" + this._wuxing);
            return;
        }

        /* internal  */onBgLoadedHandler(): void
        {
            this._bg.bitmapData = GlobalClass.getBitmapData("skillBg");
            return;
        }

        public get freeLeftTimes(): int
        {
            return this._freeLeftTimes;
        }

        public set freeLeftTimes(arg1: int)
        {
            this._freeLeftTimes = arg1;
            return;
        }

        public get cost(): int
        {
            return this._cost;
        }

        public set cost(arg1: int)
        {
            this._cost = arg1;
            return;
        }

        /* internal */ static /* const */glowFilter: Object /* flash.filters.GlowFilter */=new Object /* flash.filters.GlowFilter */(15788607, 1, 4, 4, 10);

        /* internal */ /* var */_bg: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_bitmap: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_wuxing: int;

        /* internal */ /* var */_mainAttr: int;

        /* internal */ /* var */_freeLeftTimes: int;

        /* internal */ /* var */_cost: int;
    }
